package server_demo

import (
	"fmt"
	"google.golang.org/grpc"
	"grpc_demo/service"
	"net"
)
// 直接创建grpc server
func CreateServerDirect() {
	tlis,err:=net.Listen("tcp", ":8080")
	if err!=nil{
		fmt.Println("create socket error" )
		return
	}
	server := grpc.NewServer()
	// 注册所有的服务
	service.RegisterDemoServiceServer(server,&service.SayHelloServer{})
	server.Serve(tlis)
}
